//
//  YRJShowCenterTableViewCell.m
//  YanRenjie
//
//  Created by dllo on 15/11/2.
//  Copyright (c) 2015年 yanrenjie. All rights reserved.
//

#import "YRJShowCenterTableViewCell.h"
#import "YRJTripHeader.h"
#define HEIGHT self.contentView.frame.size.height
#define WIDTH self.contentView.frame.size.width

@implementation YRJShowCenterTableViewCell
- (void)dealloc {
    [_titlePageImageView release];
    [_avatar_lImageView release];
    [_titleLabel release];
    [_date_strLabel release];
//    [_addressLabel release];
//    [_like_countLabel release];
    [_tab_listLabel release];
    
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createCell];
    }
    return self;
}

- (void)createCell {
    self.titlePageImageView = [[UIImageView alloc] init];
    [self.contentView addSubview:self.titlePageImageView];
//    self.titlePageImageView.backgroundColor = [UIColor cyanColor];
    [_titlePageImageView release];
    
    self.avatar_lImageView = [[UIImageView alloc] init];
    [self.contentView addSubview:self.avatar_lImageView];
    [_avatar_lImageView release];
//    self.avatar_lImageView.backgroundColor = [UIColor redColor];
    
    self.titleLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.titleLabel];
    [_titleLabel release];
    self.titleLabel.font = [UIFont systemFontOfSize:16 * (SWIDTH / 375)];
    self.titleLabel.numberOfLines = 2;
//    self.titleLabel.backgroundColor = [UIColor blackColor];
    
    self.date_strLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.date_strLabel];
    [_date_strLabel release];
    self.date_strLabel.font = [UIFont systemFontOfSize:12 * (WIDTH / 375)];
    self.date_strLabel.numberOfLines = 2;
//    self.date_strLabel.backgroundColor = [UIColor yellowColor];
    
//    self.addressLabel = [[UILabel alloc] init];
//    [self.contentView addSubview:self.addressLabel];
//    [_addressLabel release];
//    
//    self.like_countLabel = [[UILabel alloc] init];
//    [self.contentView addSubview:self.like_countLabel];
//    [_like_countLabel release];
    
    self.tab_listLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.tab_listLabel];
    [_tab_listLabel release];
    self.tab_listLabel.font = [UIFont systemFontOfSize:10 * (SWIDTH / 375)];
//    self.tab_listLabel.backgroundColor = [UIColor grayColor];
}

- (void)layoutSubviews {
    [super layoutSubviews];
    self.titlePageImageView.frame = CGRectMake(15, 5, WIDTH - 30, HEIGHT / 7 * 5 - 5);
    self.avatar_lImageView.frame = CGRectMake(WIDTH / 4 * 3, HEIGHT / 5 * 3, WIDTH / 6, WIDTH / 6);
    self.avatar_lImageView.layer.cornerRadius = WIDTH / 12;
    self.avatar_lImageView.layer.masksToBounds = YES;
    self.titleLabel.frame = CGRectMake(15, HEIGHT / 7 * 5, WIDTH / 4 * 3 - 20, HEIGHT / 25 * 4);
    self.date_strLabel.frame = CGRectMake(15, HEIGHT / 175 * 153, WIDTH / 5 * 4 - 20, HEIGHT / 175 * 22);
    self.tab_listLabel.frame = CGRectMake(15, HEIGHT / 175 * 153, WIDTH / 5 * 4 - 20, HEIGHT / 175 * 22);
}
- (void)awakeFromNib {
    // Initialization code
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
